exports.data = {
  json: {
    kind: "Snippet",
    body: ['"t-button": "tdesign-miniprogram/button/button"'],
    detail: "Button 按钮",
    documentation: `在app.json或index.json中引入组件`,
  },
  wxml: {
    kind: "Snippet",
    body: ["<t-button${1}>${2:默认按钮}</t-button>"],
    detail: "Button 按钮",
    documentation: `按钮用于触发一个操作，如提交表单。`,
    attrs: [
      {
        kind: "Field",
        body: ["t-id="],
        detail: "t-id",
        documentation: "按钮标签id",
        vals: null,
      },
      {
        kind: "Field",
        body: ["custom-dataset"],
        detail: "custom-dataset",
        documentation:
          "自定义 dataset，可通过 event.currentTarget.dataset.custom 获取。TS 类型：any",
        vals: null,
      },

      {
        kind: "Field",
        body: ["block"],
        detail: "block",
        documentation: "是否为块级元素",
        vals: {
          kind: "Value",
          body: ["true", "false"],
          detail: "",
          documentation: "",
        },
      },
      {
        kind: "Field",
        body: ["content="],
        detail: "content",
        documentation: "按钮内容(String / Slot)",
        vals: null,
      },
      {
        kind: "Field",
        body: ["disabled="],
        detail: "disabled",
        documentation: "是否禁用按钮",
        vals: {
          kind: "Value",
          body: ["true", "false"],
          detail: "",
          documentation: "",
        },
      },
      {
        kind: "Field",
        body: ["ghost"],
        detail: "ghost",
        documentation: "是否为幽灵按钮（镂空按钮）",
        vals: {
          kind: "Value",
          body: ["true", "false"],
          detail: "",
          documentation: "",
        },
      },
      {
        kind: "Field",
        body: ["icon="],
        detail: "icon",
        documentation:
          "图标名称。值为字符串表示图标名称，值为 Object 类型，表示透传至 icon(String / Object)",
        vals: null,
      },
      {
        kind: "Field",
        body: ["loading="],
        detail: "loading",
        documentation: "是否显示为加载状态，skyline模式下暂不支持该属性",
        vals: {
          kind: "Value",
          body: ["true", "false"],
          detail: "",
          documentation: "",
        },
      },
      {
        kind: "Field",
        body: ["shape="],
        detail: "shape",
        documentation:
          "按钮形状，有 4 种：长方形、正方形、圆角长方形、圆形。可选项：rectangle/square/round/circle",
        vals: {
          kind: "Value",
          body: ["rectangle", "square", "round", "circle"],
          detail: "",
          documentation: "",
        },
      },
      {
        kind: "Field",
        body: ["theme="],
        detail: "theme",
        documentation:
          "组件风格，依次为品牌色、危险色。可选项：default/primary/danger/light",
        vals: {
          kind: "Value",
          body: ["default", "primary", "danger", "light"],
          detail: "",
          documentation: "",
        },
      },
      {
        kind: "Field",
        body: ["variant="],
        detail: "variant",
        documentation:
          "按钮形式，基础、线框、文字。可选项：base/outline/dashed/text",
        vals: {
          kind: "Value",
          body: ["base", "outline", "dashed", "text"],
          detail: "",
          documentation: "",
        },
      },
      {
        kind: "Field",
        body: ["size="],
        detail: "size",
        documentation: "按钮尺寸，可选值为 normal large small mini",
        vals: {
          kind: "Value",
          body: ["normal", "large", "small", "mini"],
          detail: "",
          documentation: "",
        },
      },
      {
        kind: "Field",
        body: ["button-id="],
        detail: "button-id",
        documentation: "标识符，作为原生button组件的id值",
        vals: null,
      },
      {
        kind: "Field",
        body: ["type="],
        detail: "type",
        documentation: "按钮类型，可选值为 primary info warning danger",
        vals: {
          kind: "Value",
          body: ["default", "primary", "info", "warning", "danger"],
          detail: "",
          documentation: "",
        },
      },

      {
        kind: "Field",
        body: ["color="],
        detail: "color",
        documentation: "按钮颜色，支持传入linear-gradient渐变色",
        vals: null,
      },

      {
        kind: "Field",
        body: ["class-prefix="],
        detail: "class-prefix",
        documentation: "图标类名前缀，同 Icon 组件的 class-prefix 属性",
        vals: null,
      },
      {
        kind: "Field",
        body: ["plain="],
        detail: "plain",
        documentation: "是否为朴素按钮",
        vals: {
          kind: "Value",
          body: ["true", "false"],
          detail: "",
          documentation: "",
        },
      },
      {
        kind: "Field",
        body: ["round="],
        detail: "round",
        documentation: "是否为圆形按钮",
        vals: {
          kind: "Value",
          body: ["true", "false"],
          detail: "",
          documentation: "",
        },
      },
      {
        kind: "Field",
        body: ["square="],
        detail: "square",
        documentation: "是否为方形按钮",
        vals: {
          kind: "Value",
          body: ["true", "false"],
          detail: "",
          documentation: "",
        },
      },
      {
        kind: "Field",
        body: ["open-type="],
        detail: "open-type",
        documentation: "微信开放能力，具体支持可参考 微信官方文档",
        vals: {
          kind: "Value",
          body: [
            "contact",
            "share",
            "getUserInfo",
            "launchApp",
            "openSetting",
            "feedback",
            "chooseAvatar",
            "agreePrivacyAuthorization",
            "bindagreeprivacyauthorization",
          ],
          detail: "",
          documentation: "",
        },
      },
      {
        kind: "Field",
        body: ["app-parameter="],
        detail: "app-parameter",
        documentation: "打开 APP 时，向 APP 传递的参数",
        vals: null,
      },
      {
        kind: "Field",
        body: ["lang="],
        detail: "lang",
        documentation:
          "指定返回用户信息的语言，zh_CN 简体中文，zh_TW 繁体中文，en 英文",
        vals: {
          kind: "Value",
          body: ["zh_CN", "zh_TW", "en"],
          detail: "",
          documentation: "",
        },
      },
      {
        kind: "Field",
        body: ["session-from="],
        detail: "session-from",
        documentation: "会话来源",
        vals: null,
      },
      {
        kind: "Field",
        body: ["send-message-title="],
        detail: "send-message-title",
        documentation: "会话内消息卡片标题",
        vals: null,
      },
      {
        kind: "Field",
        body: ["send-message-path="],
        detail: "send-message-path",
        documentation: "会话内消息卡片点击跳转小程序路径",
        vals: null,
      },
      {
        kind: "Field",
        body: ["send-message-img="],
        detail: "send-message-img",
        documentation: "sendMessageImg",
        vals: null,
      },
      {
        kind: "Field",
        body: ["show-message-card="],
        detail: "show-message-card",
        documentation: "显示会话内消息卡片",
        vals: null,
      },
      {
        kind: "Field",
        body: ["type="],
        detail: "form-type",
        documentation: "同小程序的 formType。可选项：submit/reset",
        vals: {
          kind: "Value",
          body: ["submit", "reset"],
          detail: "",
          documentation: "",
        },
      },
      // 事件
      {
        kind: "Event",
        body: ["bind:tap="],
        detail: "bind:tap",
        documentation: "点击按钮，且按钮状态不为加载或禁用时触发",
        vals: null,
      },
      // 微信开放能力
      {
        kind: "Event",
        body: ["bind:getuserinfo="],
        detail: "bind:getuserinfo",
        documentation:
          "用户点击该按钮时，会返回获取到的用户信息，从返回参数的 detail 中获取到的值同 wx.getUserInfo",
        vals: null,
      },
      {
        kind: "Event",
        body: ["bind:contact="],
        detail: "bind:contact",
        documentation: "客服消息回调",
        vals: null,
      },
      {
        kind: "Event",
        body: ["bind:getphonenumber="],
        detail: "bind:getphonenumber",
        documentation: "获取用户手机号回调",
        vals: null,
      },
      {
        kind: "Event",
        body: ["bind:getrealtimephonenumber="],
        detail: "bind:getrealtimephonenumber",
        documentation:
          "获取手机号实时验证回调，open-type=getRealtimePhoneNumber 时有效",
        vals: null,
      },
      {
        kind: "Event",
        body: ["bind:agreeprivacyauthorization="],
        detail: "bind:agreeprivacyauthorization",
        documentation:
          '同意隐私协议回调，openType="agreePrivacyAuthorization"时有效',
        vals: null,
      },
      {
        kind: "Event",
        body: ["bind:error="],
        detail: "bind:error",
        documentation: "当使用开放能力时，发生错误的回调",
        vals: null,
      },
      {
        kind: "Event",
        body: ["bind:opensetting="],
        detail: "bind:opensetting",
        documentation: "在打开授权设置页后回调",
        vals: null,
      },
      {
        kind: "Event",
        body: ["bind:chooseavatar="],
        detail: "bind:chooseavatar",
        documentation:
          "当 open-type 的值为 chooseAvatar 时，选择头像之后的回调",
        vals: null,
      },
      {
        kind: "Field",
        body: ["t-class="],
        detail: "t-class",
        documentation: "根节点样式类",
        vals: null,
      },
      {
        kind: "Field",
        body: ["t-class-icon="],
        detail: "t-class-icon",
        documentation: "图标样式类",
        vals: null,
      },
      {
        kind: "Field",
        body: ["t-class-loading="],
        detail: "t-class-loading",
        documentation: "加载样式类",
        vals: null,
      },
    ],
  },
};
